import React from 'react';  
import FolderStore from '../stores/FolderStore'; 
import {LeftSideContainer} from "./LeftSide";
import ArchiveList from "./ArchiveList"  
import SearchView from "./SearchView";
import FillView from "./FillView";
import SearchBar from "./SearchBar";  
export default React.createClass({
    getInitialState: function () {
        return {  
        };
    },   
    componentDidMount: function(){   
        var _this = this;                  
        $('#document-navigation').on('clickNode', function(e, node) {               
            _this.gotoArchive(node);          
            _.delay(function(){
                FolderStore.setCurFolder(node);       
            }, 10);                
        });  
        //window.resizable();   
    },
    gotoArchive:function(node) {
        var hash = window.location.hash.replace( /^[^#]*#?(.*)$/, '$1' );
        var newhash = "/archive";
        if (hash.indexOf(newhash) < 0) {                  
            window.location.hash = newhash;   
        }     
    },
    componentWillUnmount:function() {          
    },       
    render: function () {
       return (
            <div>
                <div className="navpane_wrap resizable resizable1 body-2">
                    <LeftSideContainer history={this.props.history}></LeftSideContainer>
                </div>
                <div className="content resizable2 body-8">
                    {this.props.children} 
                </div>                   
            </div>
        )
        
    }
}); 
